const bannerModel = require("./model/bannerModel")

module.exports.finBannerDao = async function () {
  return await bannerModel.findAll();
}

module.exports.updataBannerDao = async function (bannerArr) {
  // 将表的记录删除
  await bannerModel.destroy({
    truncate: true,
  });
  await bannerModel.bulkCreate(bannerArr);  // 批量写入数据
  return await bannerModel.findAll();
}